package com.czxy.service;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class UserServiceAspect01 {

    @Before("execution(public  void com.czxy.service.UserService.*())")
    public  void openTx(){
        System.out.println("开启事务");

    }
    @After("execution(public  void com.czxy.service.UserService.*())")
    public  void closeTx(){
        System.out.println("关闭事务");

    }

}
